home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource for Source: C/C++
/
Resource for Source - C-C++.iso
/
codelib9
/
v_11_01
/
1101027b
< prev
next >
Wrap
Text File
|
1995-11-01
|
1KB
|
34 lines
int GetSystemInfo (int flag, unsigned char *ptr)
{
if (flag == GET_SYSTEM_INFO)
{
if ( (int)*ptr == sizeof (oSYSTEM_INFO))
{
oSYSTEM_INFO *sinfo = (oSYSTEM_INFO *)ptr;
/* don't touch extended fields */
sinfo->num_displays = _getNumDisplays();
sinfo->num_printers = _getNumPrinters();
sinfo->num_drives = _getNumDrives();
}
if ( (int)*ptr == sizeof (SYSTEM_INFO))
{
SYSTEM_INFO *sinfo = (SYSTEM_INFO *)ptr;
/* fill extended fields */
sinfo->num_displays = _getNumDisplays();
sinfo->num_printers = _getNumPrinters();
sinfo->num_drives = _getNumDrives();
sinfo->num_tapes = _getNumTapes();
}
}
if (flag == GET_DISPLAY_INFO)
{
DISPLAY_INFO *dptr = (DISPLAY_INFO *)ptr;
dptr->xpixels = _getDisplayWidth(dptr->displayno);
dptr->ypixels = _getDisplayHeight(dptr->displayno);
dptr->bits_per_pixel = _getDisplayBPPix(dptr->displayno);
dptr->planes = _getDisplayPlanes(dptr->displayno);
}
return 0;
}